<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        canvas{border: 1px solid red;}
    </style>
</head>
<body>
<canvas id="box" width="800" height="800"></canvas>
<script>
    var box=document.getElementById("box");
    var pen=box.getContext("2d");
    pen.translate(400,400);
    pen.rect(0,0,200,300);
    pen.rotate(Math.PI*180*30);
    pen.rect(0,0,200,300);
    pen.stroke();




</script>
</body>
</html>